This repository was archived by the owner on Jan 12, 2024. It is now read-only.
wip: example with deno #11
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is a WIP example of running IPFS using Deno.
Since js-ipfs uses CommonJS and Deno uses ESModule it is possible to have some compatibility with Node.JS but not every builtin is implemented and some are partly.
The std/node library
The std/node part of the Deno standard library is a Node.js compatibility layer. It's primary focus is providing "polyfills" for Node.js's built-in modules. It also provides a mechanism for loading CommonJS modules into Deno.
The library is most useful when trying to use your own or private code that was written for Node.js. If you are trying to consume public npm packages, you are likely to get a better result using a CDN.
Copied from Deno
When using this method, it throws the following error:
Alternative
It is possible to also use JSPM which will convert NPM modules to ES Modules
When using this method, it throws the following error:
Import 'https://dev.jspm.io/npm:ipns@0.13.2/src/index.dew.js' failed: 500 Internal Server Error